<script>
import Vue from 'vue'
import VueResource from 'vue-resource'
Vue.use(VueResource)
import { getToken } from '@/utils/auth'
import { getInfo } from '@/api/user'
import { findAll } from '@/api/estate'
function getAdmin() {
  return new Promise((resolve, reject) => {
    const token = getToken()
    getInfo(token).then(
      (res) => {
        if (res.data.code === 1) {
          resolve(res.data.data)
        }
        resolve(null)
      },
      (err) => {
        reject(err)
      })
  })
}
function getEstate() {
  return new Promise((resolve, reject) => {
    findAll().then(
      (res) => {
        resolve(res.data.data)
      },
      (err) => {
        reject(err)
      })
  })
}
export default {
  getAdmin, getEstate
}
</script>

